package com.ls.socketio.repository.dao;

import com.ls.socketio.bean.RoomLampInfo;
import com.ls.socketio.repository.RoomLampRepository;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author liShan
 * @date 2019/9/6 0:39
 */
@Component
public class RoomLampRepositoryImpl {

    @Resource
    private RoomLampRepository roomLampRepository;

    /**
     * 保存
     * @param info 信息
     */
    public void add(RoomLampInfo info){
        roomLampRepository.save(info);
    }

    /**
     * 根据房间id查询
     * @param roomId 房间id
     * @return 查询结果
     */
    public RoomLampInfo findByRoomId(Long roomId){
        return roomLampRepository.findByRoomId(roomId);
    }

}
